package com.ioidea.ble.en

import com.ioidea.ble.R

enum class EnumAddChildDevStatus(val code: Int,val res:Int) {


    DEVICE_ALREADY_EXIT(0, R.string.device_already_exit),//设备已存在
    DEVICE_ADD_SUCC(1, R.string.device_add_succ),//增加成功
    DEVICE_EXCEED_MAX(2, R.string.device_exceed_max);//已超出最大设备数量

    companion object {
        fun ofCode(code: Int): EnumAddChildDevStatus? {
            val enumAddChildDevStatuses = EnumAddChildDevStatus.values();
            for (enumAddChildDevStatus in enumAddChildDevStatuses) {
                if (enumAddChildDevStatus.code == code) {
                    return enumAddChildDevStatus
                }
            }

            return null
        }
    }
}